<body style="background-color: #F2F2F2;height: 100%;">
  <!--挂号信息-->
  <div class="weui-form-preview">
    <div class="weui-form-preview__bd docotorinfo">
      <!-- <div class="weui-form-preview__item">
        <label class="weui-form-preview__label font">医院</label>
        <span class="weui-form-preview__value">永川人民医院</span>
      </div> -->
      <div class="weui-form-preview__item">
        <label class="weui-form-preview__label font">科室</label>
        <span class="weui-form-preview__value">{{scheduling?.KSMC}}</span>
      </div>
      <div class="weui-form-preview__item">
        <label class="weui-form-preview__label font">医生</label>
        <span class="weui-form-preview__value">{{scheduling?.YS}}</span>
      </div>
      <div class="weui-form-preview__item">
        <label class="weui-form-preview__label font">费用</label>
        <span class="weui-form-preview__value">{{scheduling?.DJ}}元</span>
      </div>
      <div class="weui-form-preview__item">
        <label class="weui-form-preview__label font">时间</label>
        <span class="weui-form-preview__value">{{schedulingdate?.date | date:'yyyy年MM月dd日'}}&nbsp;{{scheduling?.FWMC}}</span>
      </div>
    </div>
  </div>

  <div class="weui-cells__title">确定具体时间段</div>

  <!--time1是前四个时间，time2是后面所有的时间段-->
  <div class="weui-cells weui-cells_checkbox">
    <label class="weui-cell weui-check__label chotime" for="checkbox-{{z}}" *ngFor="let i of time1,let z = index;">
      <div class="weui-cell__hd">
        <input [(ngModel)]="res.checkbox" type="radio" class="weui-check" name="radio1" [value]="i" id="checkbox-{{z}}" checked="true">
        <!-- <i class="weui-icon-checked" style="margin-top: -5px;"></i> -->
      </div>
      <div class="weui-cell__bd">
        <p style="font-size: 17px;">{{i}}</p>
      </div>
    </label>
    <div *ngIf="shown" style="margin-top: 0px;" class="weui-cells">
      <label class="weui-cell weui-check__label chotime" for="checkbox-{{j.timeId}}" *ngFor="let j of time2">
        <div class="weui-cell__hd">
          <input [(ngModel)]="res.checkbox" type="radio" class="weui-check" name="radio1" [value]="j" id="checkbox-{{j.timeId}}">
          <i class="weui-icon-checked" style="margin-top: -5px;"></i>
        </div>
        <div class="weui-cell__bd">
          <p style="font-size: 17px;">{{j.time}}</p>
        </div>
      </label>
    </div>
    <!--点击展开更多触发show事件，让shown的值改变，将time2的时间展示出来-->
    <!-- <div class="weui-cell more">
      <div (click)="show()" class="weui-cell">
        <p>{{textdown}}</p>
      </div>
    </div> -->
  </div>

  <!-- <div class="weui-cells__title">预约说明</div>

  <div class="weui-cells">
    <a class="weui-cell weui-cell_access" href="javascript:;">
      <div class="weui-cell__bd">
        <!--点击弹出提示对话框
        <p style="font-size: 14px;" weui-type="default" (click)="onShow('auto',2)">1,如果您没有就诊卡，可以先挂号，在....</p>
      </div>
      <div class="weui-cell__ft">
      </div>
    </a>
  </div> -->

  <div class="weui-cells__title">就诊人及其他信息</div>

  <!--无就诊人展示的部分-->
  <div *ngIf="patitentshow">
    <div class="weui-cells weui-cells_form paitentinfo">
      <div class="weui-cell ">
        <div class="weui-cell__hd">
          <label for="" class="weui-label">姓名</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" [(ngModel)]="name" #nameRef="ngModel" required pattern="^[a-zA-Z\u4e00-\u9fa5]+$" placeholder="填写真实姓名保证顺利取号">
        </div>
      </div>
      <div *ngIf="nameRef.invalid && (nameRef.dirty || nameRef.touched)">
        <div class="toptips" *ngIf="nameRef.errors.required||nameRef.errors.pattern">请输入正确的姓名</div>
      </div>
    </div>
    <div class="weui-cells weui-cells_form" style="margin-top: 0px">
      <div class="weui-cell ">
        <div class="weui-cell__hd">
          <label for="" class="weui-label">身份证号 </label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" [(ngModel)]="idcard" #idRef="ngModel" required pattern="d{15}||d{18}" minlength="15" maxlength="18"
            placeholder="取号时需出示身份证">
        </div>
      </div>
      <div *ngIf="idRef.invalid && (idRef.dirty || idRef.touched)">
        <div class="toptips" *ngIf="idRef.errors?.required||idRef.errors?.pattern||idRef.errors?.minlength||idRef.errors?.maxlength">请输入正确的身份证号码</div>
      </div>
    </div>
    <div class="weui-cells weui-cells_form" style="margin-top: 0px">
      <div class="weui-cell ">
        <div class="weui-cell__hd">
          <label for="" class="weui-label">手机号码 </label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" [(ngModel)]="mobile" #mobileRef="ngModel" type="tel" required minlength="11" maxlength="11" pattern="^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$"
            placeholder="用于接受确认短信">
        </div>
      </div>
      <div *ngIf="mobileRef.invalid && (mobileRef.dirty || mobileRef.touched)">
        <div class="toptips" *ngIf="mobileRef.errors?.pattern||mobileRef.errors?.minlength||mobileRef.errors?.maxlength">请输入正确的手机号码</div>
      </div>
    </div>
    <!-- <div class="weui-cells weui-cells_form" style="margin-top: 0px">
      <div class="weui-cell ">
        <div class="weui-cell__hd">
          <label for="" class="weui-label">就诊卡号 </label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="tel" weui-regex="[0-9]*" placeholder="没有就诊卡取号时补办">
        </div>
      </div>
    </div> -->
  </div>

  <!--有就诊人展示的信息-->
  <div *ngIf="!patitentshow">
    <div class="weui-cells paitentinfo">
      <!--点击就诊人时出现popup组件选择就诊人和对就诊人进行编辑-->
      <a class="weui-cell weui-cell_access" href="javascript:;" (click)="simplePopup.show()" style="padding-top: 10px;margin-bottom: -5px;">
        <div class="weui-cell__bd">
          <p style="font-size: 17px;">就诊人</p>
        </div>
        <div class="weui-cell__ft" style="background-color: white">{{res.radio?.p_name}}</div>
      </a>
      <!-- <div class="weui-cell  weui-cells_form" style="padding-top: 10px;margin-bottom: -5px;">
        <div class="weui-cell__hd">
          <label for="" class="weui-label" style="font-size: 17px;">就诊卡号</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="tel" placeholder="没有就诊卡取号时补办">
        </div>
      </div> -->
    </div>
  </div>
  <div class="btn">
    <div class="rule">
      <label>
        <input type="checkbox" checked>
        <span>已阅读并同意
          <a (click)="onShow('auto',2)">《预约说明》</a>
        </span>
      </label>
    </div>
    <button weui-button class="button" (click)="addpatientonline()">挂号</button>
  </div>

  <!--点击就诊人出现的编辑增加就诊人popup-->
  <!--也是将其放于页面底部-->

  <weui-popup #simple (confirm)="confirm()" [config]="{confirm: '编辑'}">
    <div style="margin:0px 0px 36px 0px;">
      <div class="weui-cells weui-cells_radio" style="margin-top:0px;">
        <label class="weui-cell weui-check__label" for="radio-{{index}}" *ngFor="let i of radio;let index=index">
          <div class="weui-cell__bd" (click)="check(index)">
            <p>{{i?.p_name}}</p>
          </div>
          <div *ngIf="icon" class="weui-cell__ft" style="background-color: white">
            <input [(ngModel)]="res.radio" type="radio" class="weui-check" name="radio" [value]="i" id="radio-{{index}}">
            <span class="weui-icon-checked"></span>
          </div>
          <div *ngIf="!icon" class="weui-cell__ft" style="background-color: white">
            <input [(ngModel)]="res.radio" (click)="editPatient(index)" type="radio" class="weui-check" name="radio" [value]="i" id="radio-{{index}}">
            <img src="../../assets/img/icon-edit.png" height="24" />
          </div>
        </label>
      </div>
      <!-- <div class="addpatient" *ngIf="icon">
        <a class="label" routerLink="/patient/addpatient">新增就诊人</a>
      </div> -->
    </div>
  </weui-popup>

  <!--点击预约说明弹出的对话框-->
  <!--忽必将对话框组件放在底部-->
  <weui-dialog #ios [config]="config"></weui-dialog>
  <weui-dialog #android [config]="config"></weui-dialog>
  <weui-dialog #auto [config]="config"></weui-dialog>
</body>